class AlbumDetailEntity {
  String? id;
  String? content;
  String? cover;
  String? userId;
  String? categoryId;
  String? categoryName;
  String? categoryPid;
  String? categoryPName;
  String? otherUserId;
  String? album;
  String? albumName;
  int? imgCount;
  int? status;
  String? avatar;
  String? username;
  List<String>? imgsUrl;
  int? count;
  List<Tag>? tagList;
  String? viewCount;
  String? agreeCount;
  String? collectionCount;
  String? commentCount;
  DateTime? time;

  AlbumDetailEntity({
    required this.id,
    required this.content,
    required this.cover,
    required this.userId,
    required this.categoryId,
    required this.categoryName,
    required this.categoryPid,
    required this.categoryPName,
    required this.otherUserId,
    required this.album,
    required this.albumName,
    required this.imgCount,
    required this.status,
    required this.avatar,
    required this.username,
    required this.imgsUrl,
    required this.count,
    required this.tagList,
    required this.viewCount,
    required this.agreeCount,
    required this.collectionCount,
    required this.commentCount,
    required this.time,
  });

  factory AlbumDetailEntity.fromJson(Map<String, dynamic> json) {
    return AlbumDetailEntity(
      id: json['id'],
      content: json['content'],
      cover: json['cover'],
      userId: json['userId'],
      categoryId: json['categoryId'],
      categoryName: json['categoryName'],
      categoryPid: json['categoryPid'],
      categoryPName: json['categoryPName'],
      otherUserId: json['otherUserId'],
      album: json['album'],
      albumName: json['albumName'],
      imgCount: json['imgCount'],
      status: json['status'],
      avatar: json['avatar'],
      username: json['username'],
      imgsUrl: json['imgsUrl'] == null ? null : List<String>.from(json['imgsUrl']),
      count: json['count'],
      tagList: json['tagList'] == null ? null : List<Tag>.from(json['tagList'].map((x) => Tag.fromJson(x))),
      viewCount: json['viewCount'],
      agreeCount: json['agreeCount'],
      collectionCount: json['collectionCount'],
      commentCount: json['commentCount'],
      time: json['time'] == null ? null : DateTime.parse(json['time']),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'content': content,
      'cover': cover,
      'userId': userId,
      'categoryId': categoryId,
      'categoryName': categoryName,
      'categoryPid': categoryPid,
      'categoryPName': categoryPName,
      'otherUserId': otherUserId,
      'album': album,
      'albumName': albumName,
      'imgCount': imgCount,
      'status': status,
      'avatar': avatar,
      'username': username,
      'imgsUrl': imgsUrl,
      'count': count,
      'tagList': tagList == null ? null : List<dynamic>.from(tagList!.map((x) => x.toJson())),
      'viewCount': viewCount,
      'agreeCount': agreeCount,
      'collectionCount': collectionCount,
      'commentCount': commentCount,
    };
  }
}
class AlbumDetailEntityList {
  List<AlbumDetailEntity>? datas;



  // 静态方法，用于从JSON字符串创建AlbumDetailEntityList实例
  AlbumDetailEntityList.fromJson(List<dynamic> list) {
    if (list != null) {
      datas = <AlbumDetailEntity>[];
      list.forEach((v) {
        datas!.add(AlbumDetailEntity.fromJson(v));
      });

    }

  }
}

class Tag {
  // Define your Tag structure here if needed
  String name;

  Tag({required this.name});

  factory Tag.fromJson(Map<String, dynamic> json) {
    return Tag(name: json['name']);
  }

  Map<String, dynamic> toJson() {
    return {'name': name};
  }
}